import tpl from './index.tpl';
import './index.scss';
import tools from '../../../utils/tools';
class Search {
  constructor () {
    this.name = 'headerSearch';
    this.tpl = tpl;
  }
  searchPhone () {
    const $searchInput = $('#J_keyword'),
          $searchForm = $('#J_searchForm');

    const keyword = tools.trimSpace($searchInput.val()),
          action = $searchForm.prop('action'),
          keywordLen = keyword.length;
    if (keywordLen > 0) {
      window.open(action + '?keyword=' + keyword)
    }
  }
}
export { Search }